﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Graphics;

namespace PROJECT_BOMBER.BLL
{
    public class LoadState : GameState
    {
        GameState _level;
        internal Texture2D img;

        public GameState Level
        {
            get { return _level; }
            set { _level = value; }
        }


        public LoadState(GameState level)
        {
            Level = level;
        }


        public override void Initialize()
        {
            //PauseText = "Chargement";
            PauseTextPosition = new Vector2(300, 300);

            img = Globals.Content.Load<Texture2D>("chargement");
        }

        public override void Update(float deltatime)
        {
        }

        public override void Draw()
        {
            Globals.GDM.GraphicsDevice.Clear(Color.Gray);

            Globals.SpriteBatch.Begin();

            //Globals.SpriteBatch.DrawString(Globals.ArialFont, PauseText, PauseTextPosition, Color.Lavender);

            Globals.SpriteBatch.Draw(img, new Vector2((Globals.GDM.PreferredBackBufferWidth - 972) / 2, (Globals.GDM.PreferredBackBufferHeight - 685) / 2), Color.White);
            Globals.GDM.GraphicsDevice.Clear(Color.Black);

            Globals.SpriteBatch.End();

            Globals.GameStateStack.Unload();

            Globals.GameStateStack.Set(Level);
        }

        //private String PauseText = null;
        private Vector2 PauseTextPosition = Vector2.Zero;


        public override void Load()
        {
        }

        public override void Unload()
        {
        }
    }
}
